/******************************************************************************
 *
 * Project:		mGameEngine
 * File:		brightnesscontrast.h
 * Author:		twoja stara
 * Created on:	2009-09-20
 *
 ******************************************************************************/

#ifndef BRIGHTNESSCONTRAST_H_
#define BRIGHTNESSCONTRAST_H_

#include "postprocess.h"

namespace mGameEngine
{
namespace Graphics
{

/**
 * Brightness and contrast adjustment post-process.
 * Allows manual control over image brightness and contrast.
 * Very useful when using other post-processes to adjust their effect.
 * It simply transforms color: RGB' = contrast * RGB + brightness.
 */
class BrightnessContrast: public PostProcess
{
protected:
	/**
	 * Brightness.
	 */
	float _brightness;

	/**
	 * Contrast.
	 */
	float _contrast;

public:
	/**
	 * Create new brightness and contrast post-process.
	 * @param brightness brightness.
	 * @param contrast contrast.
	 * @param texture input image texture.
	 * @param target output render target.
	 */
	BrightnessContrast(float brightness = 0.0f, float contrast = 1.0f,
					const Texture *texture = NULL, RenderTarget *target = NULL);

	/**
	 * Destroy brightness and contrat post-process.
	 */
	virtual ~BrightnessContrast();

	/**
	 * Get brightness.
	 * @return brightness.
	 */
	float getBrightness() const
	{
		return _brightness;
	}

	/**
	 * Set brightness.
	 * @param brightness brightness.
	 */
	void setBrightness(float brightness);

	/**
	 * Get contrast.
	 * @return contrast.
	 */
	float getContrast() const
	{
		return _contrast;
	}

	/**
	 * Set contrast.
	 * @param contrast contrast.
	 */
	void setContrast(float contrast);
};

}
}

#endif // BRIGHTNESSCONTRAST_H_
